package com.jiming.webrpc;

import com.jiming.webrpc.firewall.Win10FirewallUtile;

public class WebRpc {
	private static final WebRpc webRpc = new WebRpc();
	
	private LocalHost localHost = null;
	
	private WebRpc() {}
	
	public static WebRpc newInstance() {
		//本地防火墙设置
		Win10FirewallUtile.addRuleByName(Win10FirewallUtile.java_rule_name);
		
		//其他操作系统暂时不支持
		
		
		return webRpc;
	}
	
	public LocalHost createLocalHost(String token, String email, SessionRequestHandler sessionRequestHandler)  throws Exception {
		this.localHost = LocalHost.newInstance(token, email, sessionRequestHandler);
		
		//开启webrpc功能
		this.localHost.start();
		
		return this.localHost;
	}


	
	
	
	
}
